home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 November / SGI Freeware 1999 November - Disc 1.iso / dist / fw_teTeX.idb / usr / freeware / info / dvips.info-2.z / dvips.info-2 (.txt)
GNU Info File  |  1999-10-18  |  48KB  |  879 lines

  1. This is Info file dvips.info, produced by Makeinfo version 1.68 from
  2. the input file dvips.texi.
  3. INFO-DIR-SECTION TeX
  4. START-INFO-DIR-ENTRY
  5. * DVI-to-Postscript: (dvips).        Translating TeX DVI files to PostScript.
  6. * afm2tfm: (dvips)Invoking afm2tfm.  Making Type 1 fonts available to TeX.
  7. * dvips: (dvips)Invoking Dvips.      DVI-to-PostScript translator.
  8. END-INFO-DIR-ENTRY
  9. File: dvips.info,  Node: Configuration file commands,  Prev: Configuration file searching,  Up: Config files
  10. Configuration file commands
  11. ---------------------------
  12.   Most of the configuration file commands are similar to corresponding
  13. command line options, but there are a few exceptions.  When they are the
  14. same, we omit the description here.
  15.   As with command line options, many may be turned off by suffixing the
  16. letter with a zero (`0').
  17.   Within a configuration file, empty lines, and lines starting with a
  18. space, asterisk, equal sign, percent sign, or pound sign are ignored.
  19. There is no provision for continuation lines.
  20. `@ NAME HSIZE VSIZE'
  21.      Define paper sizes.  *Note Config file paper sizes::.
  22.      Memory conservation.  Same as `-a', *note Option details::..
  23. `b #COPIES'
  24.      Multiple copies.  Same as `-b', *note Option details::..
  25. `D DPI'
  26.      Output resolution.  Same as `-D', *note Option details::..
  27. `e NUM'
  28.      Max drift.  Same as `-e', *note Option details::..
  29. `E COMMAND'
  30.      Executes the command listed with `system'(3); can be used to get
  31.      the current date into a header file for inclusion, for instance.
  32.      Possibly dangerous; this may be disabled, in which case a warning
  33.      will be printed if the option is used (and warnings are not
  34.      suppressed).
  35.      Run as a filter.  Same as `-f', *note Option details::..
  36. `h HEADER'
  37.      Prepend HEADER to output.  Same as `h-', *note Option details::..
  38. `H PATH'
  39.      Use PATH to search for PostScript header files.  The environment
  40.      variable `DVIPSHEADERS' overrides this.
  41. `i N'
  42.      Make multiple output files.  Same as `-i -S N', *note Option
  43.      details::..
  44.      Partially download Type 1 fonts.  Same as `-j', *note Option
  45.      details::..
  46.      Remove comments from included PostScript files.  Same as `-K',
  47.      *note Option details::..
  48. `m NUM'
  49.      Declare NUM as the memory available for fonts and strings in the
  50.      printer.  Default is 180000.  This value must be accurate if memory
  51.      conservation and document splitting is to work correctly.  To
  52.      determine this value, send the following file to the printer:
  53.           %! Hey, we're PostScript
  54.           /Times-Roman findfont 30 scalefont setfont 144 432 moveto
  55.           vmstatus exch sub 40 string cvs show pop showpage
  56.      The number printed by this file is the total memory free; it is
  57.      usually best to tell Dvips that the printer has slightly less
  58.      memory, because many programs download permanent macros that can
  59.      reduce the memory in the printer.  Some systems or printers can
  60.      dynamically increase the memory available to a PostScript
  61.      interpreter, in which case this file might return a ridiculously
  62.      low number; for example, the NeXT computer and Ghostscript.  In
  63.      these cases, a value of one million works fine.
  64. `M MODE'
  65.      Metafont mode.  Same as `-mode', *note Option details::..
  66.      Disable structured comments.  Beware: This also turns off
  67.      displaying page numbers or changing to specific pagenumbers in
  68.      PostScript viewers.  Same as `-N', *note Option details::..
  69. `o NAME'
  70.      Send output to NAME.  Same as `-', *note Option details::..  In
  71.      the file `config.foo', a setting like this is probably appropriate:
  72.           o |lpr -Pfoo
  73.      The MS-DOS version will emulate spooling to `lpr' by printing to
  74.      the local printer device `PRN' if it doesn't find an executable
  75.      program by that name in the current directory or along the `PATH'.
  76. `O XOFF,YOFF'
  77.      Origin offset.  Same as `-O', *note Option details::..
  78. `p [+]NAME'
  79.      Examine NAME for PostScript font aliases.  Default is
  80.      `psfonts.map'.  This option allows you to specify different
  81.      resident fonts that different printers may have.  If NAME starts
  82.      with a `+' character, then the rest of the name (after any leading
  83.      spaces) is used as an additional map file; thus, it is possible to
  84.      have local map files pointed to by local configuration files that
  85.      append to the global map file.  This can be used for font families.
  86. `P PATH'
  87.      Use PATH to search for bitmap PK font files is PATH.  The
  88.      `PKFONTS', `TEXPKS', `GLYPHFONTS', and `TEXFONTS' environment
  89.      variables override this.  *Note Supported file formats:
  90.      (kpathsea)Supported file formats.
  91.      Run quietly.  Same as `-q', *note Option details::..
  92.      Page reversal.  Same as `-r', *note Option details::..
  93. `R NUM1 NUM2 ...'
  94.      Define the list of default resolutions for PK fonts.  If a font
  95.      size actually used in a document is not available and cannot be
  96.      created, Dvips will scale the font found at the closest of these
  97.      resolutions to the requested size, using PostScript scaling.  The
  98.      resulting output may be ugly, and thus a warning is issued.  To
  99.      turn this last-resort scaling off, use a line with just the `R'
  100.      and no numbers.
  101.      The given numbers must be sorted in increasing order; any number
  102.      smaller than the preceding one is ignored.  This is because it is
  103.      better to scale a font up than down; scaling down can obliterate
  104.      small features in the character shape.
  105.      The environment and config file values `DVIPSSIZES' or `TEXSIZES'
  106.      override this configuration file setting.
  107.      If no `R' settings or environment variables are specified, a list
  108.      compiled in during installation is used. This default list is
  109.      defined by the Makefile variable `default_texsizes', defined in
  110.      the file `make/paths.make'.
  111.      Output global save/restore.  Same as `-s', *note Option details::..
  112. `S PATH'
  113.      Use PATH to search for special illustrations (Encapsulated
  114.      PostScript files or psfiles).  The `TEXPICTS' and then `TEXINPUTS'
  115.      environment variables override this.
  116. `T PATH'
  117.      Use PATH to search for TFM files.  The `TFMFONTS' and then
  118.      `TEXFONTS' environment variables overrides this.  This path is used
  119.      for resident fonts and fonts that can't otherwise be found.
  120.      Work around bug in Xerox 4045 printer.  Same as `-U', *note Option
  121.      details::..
  122. `V PATH'
  123.      Use PATH to search for virtual font files.  This may be
  124.      device-dependent if you use virtual fonts to simulate actual fonts
  125.      on different devices.
  126. `W [STRING]'
  127.      If STRING is supplied, write it to standard error after reading
  128.      all the configuration files; with no STRING, cancel any previous
  129.      `W' message.  This is useful in the default configuration file to
  130.      remind users to specify a printer, for instance, or to notify users
  131.      about special characteristics of a particular printer.
  132. `X NUM'
  133.      Horizontal resolution.  Same as `-X', *note Option details::..
  134. `Y NUM'
  135.      Vertical resolution.  Same as `-Y', *note Option details::..
  136.      Compress bitmap fonts.  Same as `-Z', *note Option details::..
  137. File: dvips.info,  Node: Paper size and landscape,  Next: Interaction with PostScript,  Prev: Invoking Dvips,  Up: Top
  138. Paper size and landscape orientation
  139. ************************************
  140.   Most TeX documents at a particular site are designed to use the
  141. standard paper size (letter size in the United States, A4 in Europe).
  142. The Dvips program can be customized either sitewide or for a particular
  143. printer.
  144.   But many documents are designed for other paper sizes.  For instance,
  145. you may want to design a document that has the long edge of the paper
  146. horizontal.  This can be useful when typesetting booklets, brochures,
  147. complex tables, or many other documents.  This type of paper orientation
  148. is called "landscape" orientation (the default orientation is
  149. "portrait").  Alternatively, a document might be designed for ledger or
  150. A3 paper.
  151.   Since the intended paper size is a document design decision, not a
  152. printing decision, such information should be given in the TeX file and
  153. not on the Dvips command line.  For this reason, Dvips supports a
  154. `papersize' special.  It is hoped that this special will become
  155. standard over time for TeX previewers and other printer drivers.
  156. * Menu:
  157. * papersize special::           Specifying the paper size in TeX.
  158. * Config file paper sizes::     Specifying printer- and site-specific sizes.
  159. * Paper trays::                 Changing paper trays automatically.
  160. File: dvips.info,  Node: papersize special,  Next: Config file paper sizes,  Up: Paper size and landscape
  161. `papersize' special
  162. ===================
  163.   The format of the `papersize' special is
  164.      \special{papersize=WIDTH,HEIGHT}
  165. WIDTH is the horizontal size of the page, and HEIGHT is the vertical
  166. size.  The dimensions supported are the same as for TeX; namely, in
  167. (inches), cm (centimeters), mm (millimeters), pt (points), sp (scaled
  168. points), bp (big points, the same as the default PostScript unit), pc
  169. (picas), dd (didot points), and cc (ciceros).
  170.   For a US letter size landscape document, the `papersize' would be:
  171.      \special{papersize=11in,8.5in}
  172. An alternate specification of `landscape':
  173.      \special{landscape}
  174. This is supported for backward compatibility, but it is hoped that
  175. reventually the `papersize' comment will dominate.
  176.   Of course, such a `\special' only informs Dvips of the desired paper
  177. size; you must also adjust `\hsize' and `\vsize' in your TeX document
  178. typeset to those dimensions.
  179.   The `papersize' special must occur somewhere on the first page of the
  180. document.
  181. File: dvips.info,  Node: Config file paper sizes,  Next: Paper trays,  Prev: papersize special,  Up: Paper size and landscape
  182. Configuration file paper size command
  183. =====================================
  184.   The `@' command in a configuration file sets the paper size defaults
  185. and options.  The first `@' command defines the default paper size.  It
  186. has three possible parameters:
  187.      @ [NAME [HSIZE VSIZE]]
  188.   If `@' is specified on a line by itself, with no parameters, it
  189. instructs Dvips to discard all previous paper size information (possibly
  190. from another configuration file).
  191.   If three parameters are given, with the first parameter being a name
  192. and the second and third being a dimension (as in `8.5in' or `3.2cc',
  193. just like in the `papersize' special), then the option is interpreted
  194. as starting a new paper size description, where NAME is the name and
  195. HSIZE and VSIZE define the horizontal and vertical size of the sheet of
  196. paper, respectively. For example:
  197.      @ letterSize 8.5in 11in
  198.   If both HSIZE and VSIZE are zero (you must still specify units!) then
  199. any page size will match.  If the `@' character is immediately followed
  200. by a `+' sign, then the remainder of the line (after skipping any
  201. leading blanks) is treated as PostScript code to send to the printer,
  202. presumably to select that particular paper size:
  203.      @ letter 8.5in 11in
  204.      @+ %%BeginPaperSize: Letter
  205.      @+ letter
  206.      @+ %%EndPaperSize
  207.   After all that, if the first character of the line is an exclamation
  208. point, then the line is put in the initial comments section of the final
  209. output file; else, it is put in the setup section of the output file.
  210. For example:
  211.      @ legal 8.5in 14in
  212.      @+ ! %%DocumentPaperSizes: Legal
  213.      @+ %%BeginPaperSize: Legal
  214.      @+ legal
  215.      @+ %%EndPaperSize
  216.   When Dvips has a paper format name given on the command line, it looks
  217. for a match by the NAME; when it has a `papersize' special, it looks
  218. for a match by dimensions.  The first match found (in the order the
  219. paper size information is found in the configuration file) is used.  If
  220. nothing matches, a warning is printed and the first paper size is used.
  221. The dimensions must match within a quarter of an inch.  Landscape mode
  222. for all paper sizes is automatically supported.
  223.   If your printer has a command to set a special paper size, then give
  224. dimensions of `0in 0in'; the PostScript code that sets the paper size
  225. can refer to the dimensions the user requested as `hsize' and `vsize';
  226. these will be macros defined in the PostScript that return the
  227. requested size in default PostScript units.  Virtually all of the
  228. PostScript commands you use here are device-dependent and degrade the
  229. portability of the file; that is why the default first paper size entry
  230. should not send any PostScript commands down (although a structured
  231. comment or two would be okay).  Also, some printers want
  232. `BeginPaperSize' comments and paper size setting commands; others (such
  233. as the NeXT) want `PaperSize' comments and they will handle setting the
  234. paper size.  There is no solution I could find that works for both
  235. (except maybe specifying both).
  236.   The Perl 5 script `contrib/mkdvipspapers' in the distribution
  237. directory may help in determining appropriate paper size definitions.
  238.   If your printers are configured to use A4 paper by default, the
  239. configuration file (probably the global `config.ps' in this case)
  240. should include this as the first `@' command:
  241.      @ A4size 210mm 297mm
  242.      @+ %%PaperSize: A4
  243. so that `A4size' is used as the default, and not `A4' itself; thus, no
  244. PostScript `a4' command is added to the output file, unless the user
  245. explicitly says to use paper size `a4'.  That is, by default, no paper
  246. size PostScript command should be put in the output, but Dvips will
  247. still know that the paper size is A4 because `A4size' is the first (and
  248. therefore default) size in the configuration file.
  249.   Executing the `letter' or `a4' or other PostScript operators cause
  250. the document to be nonconforming and can cause it not to print on
  251. certain printers, so the default paper size should not execute such an
  252. operator if at all possible.
  253. File: dvips.info,  Node: Paper trays,  Prev: Config file paper sizes,  Up: Paper size and landscape
  254. Paper trays
  255. ===========
  256.   Some printers, such as the Hewlett-Packard HP4si, have multiple paper
  257. trays.  You can set up Dvips to take advantage of this using the
  258. `bop-hook' PostScript variable (*note PostScript hooks::.).
  259.   For example, suppose you have an alternate tray stocked with
  260. letterhead paper; the usual tray has the usual paper.  You have a
  261. document where you want the first page printed on letterhead, and the
  262. remaining pages on the usual paper. You can create a header file, say
  263. `firstletterhead.PS', with the following (PostScript) code (`bop-hook'
  264. is passed the current physical page number, which starts at zero):
  265.      /bop-hook { dup 0 eq { ALTERNATETRAY } { NORMALTRAY } ifelse } def
  266. where ALTERNATETRAY and NORMALTRAY are the appropriate commands to
  267. select the paper trays.  On the 4SI, ALTERNATETRAY is `statusdict begin
  268. 1 setpapertray end' and NORMALTRAY is `statusdict begin 0 setpapertray
  269. end'.
  270.   Then, include the file with either
  271.    * the `-h' command-line option (*note Option details::.); or
  272.    * the `h' config file option (*note Configuration file commands::.);
  273.      or
  274.    * `\special{header=FILE}' in your TeX document (*note Including
  275.      headers from TeX: Including headers from TeX.).
  276. File: dvips.info,  Node: Interaction with PostScript,  Next: PostScript fonts,  Prev: Paper size and landscape,  Up: Top
  277. Interaction with PostScript
  278. ***************************
  279.   Dvips supports inclusion of PostScript figure files (e.g.,
  280. Encapsulated PostScript), downloading other header files (e.g., fonts),
  281. including literal PostScript code, and hypertext.
  282. * Menu:
  283. * PostScript figures::          Including an Encapsulated PostScript figure.
  284. * Header files::                Downloading extra definitions.
  285. * Literal PS::                  Writing literal PostScript code.
  286. * Hypertext::                   Producing HyperPostScript to make PDF.
  287. File: dvips.info,  Node: PostScript figures,  Next: Header files,  Up: Interaction with PostScript
  288. PostScript figures
  289. ==================
  290.   Scaling and including PostScript graphics is a breeze--if the
  291. PostScript file is correctly formed.  Even if it is not, however, the
  292. file can usually be accommodated with just a little more work.
  293. * Menu:
  294. * Bounding box::                The %%BoundingBox EPS comment.
  295. * EPSF macros::                 Including the file in TeX.
  296. * psfile special::              The basic special.
  297. * Dynamic creation of graphics:: Handling compressed or generated figures.
  298. * Fonts in figures::            The %*Font comment.
  299. File: dvips.info,  Node: Bounding box,  Next: EPSF macros,  Up: PostScript figures
  300. The bounding box comment
  301. ------------------------
  302.   The most important feature of a good PostScript file from the
  303. standpoint of including it in another document is an accurate bounding
  304. box comment.  Every well-formed PostScript file has a comment
  305. describing where on the page the graphic is located, and how big that
  306. graphic is.
  307.   This information is given as the lower left and upper right corners of
  308. the box just enclosing the graphic, and is thus referred to as the
  309. "bounding box".  These coordinates are given in the default PostScript
  310. units (there are precisely 72 PostScript units to the inch, like TeX
  311. big points) with respect to the lower left corner of the sheet of paper.
  312.   To see if a PostScript file has a bounding box comment, just look at
  313. the first few lines of the file.  PostScript files are standard ASCII,
  314. so you can use any text editor to do this.  If within the first few
  315. dozen lines there is a line like
  316.      %%BoundingBox: 25 50 400 300
  317. (with any reasonable numbers), chances are very good that the file is
  318. Encapsulated PostScript and will work easily with Dvips.  If the file
  319. contains instead a line like
  320.      %%BoundingBox: (atend)
  321. the file is still probably Encapsulated PostScript, but the bounding box
  322. is given at the end of the file.  Dvips needs it at the beginning.  You
  323. can move it with that same text editor, or a simple script.  (The
  324. bounding box is given in this way when the program that generated the
  325. PostScript couldn't know the size in advance, or was too lazy to compute
  326.   If the document lacks a `%%BoundingBox:' altogether, you can
  327. determine one in a couple of ways.  One is to use the `bbfig' program
  328. distributed with Dvips in the `contrib' directory. This can usually
  329. find the correct bounding box automatically; it works best with
  330. Ghostscript.
  331.   If the comment looks like this:
  332.      %%BoundingBox: 0 0 612 792
  333. the graphic claims to take up an entire sheet of paper.  This is
  334. usually a symptom of a bug in the program that generated it.
  335.   The other is to do it yourself: print the file.  Now, take a ruler,
  336. and make the following measurements (in PostScript units, so measure in
  337. inches and multiply by 72): From the left edge of the paper to the
  338. leftmost mark on the paper is LLX, the first number.  From the bottom
  339. edge of the paper to the bottommost mark on the paper is LLY, the
  340. second number.  From the left edge of the paper to the rightmost mark
  341. on the paper is URX, the third number.  The fourth and final number,
  342. URY, is the distance from the bottom of the page to the uppermost mark
  343. on the paper.
  344.   Once you have the numbers, add a comment of the following form as the
  345. second line of the document.  (The first line should already be a line
  346. starting with the two characters `%!'; if it is not, the file probably
  347. isn't PostScript.)
  348.      %%BoundingBox: LLX LLY URX URY
  349. Or, if you don't want to modify the file, you can simply write these
  350. numbers down in a convenient place and give them in your TeX document
  351. when you import the graphic, as described in the next section.
  352.   If the document does not have such a bounding box, or if the bounding
  353. box is given at the end of the document, or the bounding box is wrong,
  354. please complain to the authors of the software package that generated
  355. the file.
  356. File: dvips.info,  Node: EPSF macros,  Next: psfile special,  Prev: Bounding box,  Up: PostScript figures
  357. Using the EPSF macros
  358. ---------------------
  359.   Once the figure file has a bounding box comment (see the previous
  360. section,) you are ready it the graphic into a TeX document.  Many
  361. packages for using EPS files exist.  One distributed with Dvips is the
  362. files `epsf.tex' (for plain TeX) and `epsf.sty' (for LaTeX).  For plain
  363. TeX, add a line like this near the top of your input file:
  364.      \input epsf
  365. If you are using LaTeX 2e, use the `graphics' or `graphicx' package.
  366. If you are using LaTeX 2.09, add the `epsf' style option, as in:
  367.      \documentstyle[12pt,epsf]{article}
  368. In any case, the above only needs to be done once, no matter how many
  369. figures you plan to include.
  370.   Now, at the point you want to include a file, enter a line such as:
  371.      \epsffile{foo.eps}
  372.   If you are using LaTeX, you may need to add `\leavevmode' immediately
  373. before the `\epsffile' command to get certain environments to work
  374. correctly.  If your file does not have a bounding box comment, you can
  375. supply the numbers as determined in the previous section, in the same
  376. order they would have been in a normal bounding box comment:
  377.      \epsffile[100 100 500 500]{foo.ps}
  378. Now, save your changes and run TeX and Dvips; the output should have
  379. your graphic positioned at precisely the point you indicated, occupying
  380. the proper amount of space.
  381.   The `\epsffile' macro typesets the figure as a TeX `\vbox' at the
  382. point of the page that the command is executed.  By default, the
  383. graphic will have its `natural' width (namely, the width of its bounding
  384. box).  The TeX box will have depth zero and its natural height.  By
  385. default, the graphic will be scaled by any DVI magnification in effect,
  386. just as is everything else in your document.  See the next section for
  387. more information on scaling.
  388.   If you want TeX to report the size of the figure as a message on your
  389. terminal when it processes each figure, give the command:
  390.      \epsfverbosetrue
  391. * Menu:
  392. * EPSF scaling::
  393. * EPSF clipping::
  394. File: dvips.info,  Node: EPSF scaling,  Next: EPSF clipping,  Up: EPSF macros
  395. EPSF scaling
  396. ............
  397.   Usually, you will want to scale an EPSF figure to some size
  398. appropriate for your document, since its natural size is determined by
  399. the creator of the EPS file.
  400.   The best way to do this is to assign the desired size to the TeX
  401. `\epsfxsize' or `\epsfysize' variables, whichever is more convenient
  402. for you.  That is, put
  403.      \epsfxsize=DIMEN
  404. right before the call to `\epsffile'.  Then the width of the TeX box
  405. will be DIMEN and its height will be scaled proportionately.
  406. Similarly, you can set the vertical size with
  407.      \epsfysize=DIMEN
  408. in which case the height will be set and the width scaled
  409. proportionally.
  410.   If you set both, both will be honored, but the aspect ratio of the
  411. included graphic may necessarily be distorted, i.e., its contents
  412. stretched in one direction or the other.
  413.   You can resize graphics in a more general way by redefining the
  414. `\epsfsize' macro.  `\epsffile' calls this with two parameters: the
  415. natural horizontal and vertical sizes of the PostScript graphic.
  416. `\epsfsize' must expand to the desired horizontal size, that is, the
  417. width of the `\vbox'.  Schematically:
  418.      \def\epsfsize#1#2{BODY}
  419.   Some useful definitions of BODY:
  420. `\epsfxsize'
  421.      This definition (the default) enables the default features listed
  422.      above, by setting `\epsfxsize' to the same value it had before the
  423.      macro was called.
  424.      Force the natural size by returning the first parameter (the
  425.      original width).
  426. `0pt'
  427.      A special case, equivalent to `#1'.
  428. `0.5#1'
  429.      Scale to half the natural size.
  430. `\hsize'
  431.      Scale to the current `\hsize'.  (In LaTeX, use `\textwidth'
  432.      instead of `\hsize'.)
  433. `\ifnum#1>\hsize\hsize\else#1\fi'
  434.      If the natural width is greater than the current `\hsize', scale to
  435.      `\hsize', otherwise use the natural width.
  436.   For compatibility with other PostScript drivers, it is possible to
  437. turn off the default scaling of included figures by the DVI
  438. magnification with the following TeX command:
  439.      \special{! /magscale false def}
  440. Use of this command is not recommended because it will make the
  441. `\epsffile' graphics the "wrong" size if global magnification is being
  442. used, and it will cause any PostScript graphics to appear improperly
  443. scaled and out of position if a DVI to DVI program is used to scale or
  444. otherwise modify the document.
  445.   DVI magnification is not applied to any output from code you write in
  446. `bop-hook' or its ilk (*note PostScript hooks::.),
  447. File: dvips.info,  Node: EPSF clipping,  Prev: EPSF scaling,  Up: EPSF macros
  448. EPSF clipping
  449. .............
  450.   By default, clipping is disabled for included EPSF images.  This is
  451. because clipping to the bounding box dimensions often cuts off a small
  452. portion of the figure, due to slightly inaccurate bounding box
  453. arguments.  The problem might be subtle; lines around the boundary of
  454. the image might be half their intended width, or the tops or bottoms of
  455. some text annotations might be sliced off.  If you want to turn
  456. clipping on, just use the command
  457.      \epsfclipon
  458. and to turn clipping back off, use
  459.      \epsfclipoff
  460. File: dvips.info,  Node: psfile special,  Next: Dynamic creation of graphics,  Prev: EPSF macros,  Up: PostScript figures
  461. `psfile' special
  462. ----------------
  463.   The basic special for file inclusion is as follows:
  464.      \special{psfile=FILENAME.ps [KEY=VALUE] ... }
  465. This downloads the PostScript file `FILENAME.ps' such that the current
  466. point will be the origin of the PostScript coordinate system.  The
  467. optional KEY=VALUE assignments allow you to specify transformations on
  468. the PostScript.
  469.   The possible KEYs are:
  470. `hoffset'
  471.      The horizontal offset (default 0)
  472. `voffset'
  473.      The vertical offset (default 0)
  474. `hsize'
  475.      The horizontal clipping size (default 612)
  476. `vsize'
  477.      The vertical clipping size (default 792)
  478. `hscale'
  479.      The horizontal scaling factor (default 100)
  480. `vscale'
  481.      The vertical scaling factor (default 100)
  482. `angle'
  483.      The rotation (default 0)
  484. `clip'
  485.      Enable clipping to the bounding box
  486.   The dimension parameters are all given in PostScript units.  The
  487. `hscale' and `vscale' are given in non-dimensioned percentage units,
  488. and the rotation value is specified in degrees.  Thus
  489.      \special{psfile=foo.ps hoffset=72 hscale=90 vscale=90}
  490. will shift the graphics produced by file `foo.ps' right by one inch and
  491. will draw it at 0.9 times normal size.  Offsets are given relative to
  492. the point of the special command, and are unaffected by scaling or
  493. rotation.  Rotation is counterclockwise about the origin.  The order of
  494. operations is to rotate the figure, scale it, then offset it.
  495.   For compatibility with older PostScript drivers, it is possible to
  496. change the units that `hscale' and `vscale' are given in.  This can be
  497. done by redefining `@scaleunit' in `SDict' by a TeX command such as
  498.      \special{! /@scaleunit 1 def}
  499. The `@scaleunit' variable, which is by default 100, is what `hscale'
  500. and `vscale' are divided by to yield an absolute scale factor.
  501. File: dvips.info,  Node: Dynamic creation of graphics,  Next: Fonts in figures,  Prev: psfile special,  Up: PostScript figures
  502. Dynamic creation of PostScript graphics files
  503. ---------------------------------------------
  504.   PostScript is an excellent page description language--but it does tend
  505. to be rather verbose.  Compressing PostScript graphics files can reduce
  506. them by factor of five or more.  For this reason, if the name of an
  507. included PostScript file ends with `.Z' or `.gz', Dvips automatically
  508. runs `gzip -d'.  For example:
  509.      \epsffile[72 72 540 720]{foo.ps.gz}
  510. Since the results of such a command are not accessible to TeX, if you
  511. use this facility with the `epsf' macros, you need to supply the
  512. bounding box parameter yourself, as shown.
  513.   More generally, if the filename parameter to one of the graphics
  514. inclusion techniques starts with a left quote (``'), the parameter is
  515. instead interpreted as a command to execute that will send the actual
  516. file to standard output.  For example:
  517.      \special{psfile="`gnuplot foo"}
  518. to include the file `foo'.  Of course, the command to be executed can
  519. be anything, including using a file conversion utility such as `tek2ps'
  520. or whatever is appropriate.  This feature can be disabled with the `-R'
  521. command-line option or `R' configuration option.
  522. File: dvips.info,  Node: Fonts in figures,  Prev: Dynamic creation of graphics,  Up: PostScript figures
  523. Fonts in figures
  524. ----------------
  525.   You can use any font available to TeX and Dvips within a graphics
  526. file by putting a `%*Font:' line in the leading commentary of the file.
  527. Schematically, this looks like:
  528.      %*Font: TFMNAME SCALEDBP DESIGNBP HEX-START:HEX-BITSTRING
  529.   Here is the meaning of each of these elements:
  530. TFMNAME
  531.      The TeX TFM filename, e.g., `cmr10'.  You can give the same
  532.      TFMNAME on more than one `%*Font' line; this is useful when the
  533.      number of characters from the font used needs a longer
  534.      HEX-BITSTRING (see item below) than conveniently fits on one line.
  535. SCALEDBP
  536.      The size at which you are using the font, in PostScript points (TeX
  537.      big points).  72bp = 72.27pt = 1in.
  538. DESIGNBP
  539.      The designsize of the font, again in PostScript points.  This
  540.      should match the value in the TFM file TFMNAME.  Thus, for `cmr10',
  541.      it should be `9.96265'.
  542. HEX-START
  543.      The character code of the first character used from the font,
  544.      specified as two ASCII hexadecimal characters, e.g., `4b' or `4B'
  545.      for `K'.
  546. HEX-BITSTRING
  547.      An arbitrary number of ASCII hexadecimal digits specifying which
  548.      characters following (and including) HEX-START are used.  This is
  549.      treated as a bitmap.  For example, if your figure used the single
  550.      letter `K', you would use `4b:8' for HEX-START and HEX-BITSTRING.
  551.      If it used `KLMNP', you would use `4b:f4'.
  552.   MetaPost's output figures contain lines like this for bitmap fonts
  553. used in a MetaPost label (*note MetaPost: (web2c)MetaPost.).
  554. File: dvips.info,  Node: Header files,  Next: Literal PS,  Prev: PostScript figures,  Up: Interaction with PostScript
  555. PostScript header files
  556. =======================
  557.   "Header files" are bits of PostScript included in the output file;
  558. generally they provide support for special features, rather than
  559. producing any printed output themselves.  You can explicitly request
  560. downloading header files if necessary for some figure, or to achieve
  561. some special effect.
  562.   Dvips includes some headers on its own initiative, to implement
  563. features such as PostScript font reencoding, bitmap font downloading,
  564. handling of `\special''s, and so on.  These standard headers are the
  565. `.pro' files (for "prologue") in the installation directory
  566. `$(psheaderdir)'; they are created from the `.lpro' ("long prologue")
  567. files in the distribution by stripping comments, squeezing blank lines,
  568. etc., for maximum efficiency.  If you want to peruse one of the
  569. standard header files, read the `.lpro' version.
  570.   The PostScript dictionary stack will be at the `userdict' level when
  571. header files are included.
  572. * Menu:
  573. * Including headers from TeX::
  574. * Including headers from the command line::
  575. * Headers and memory usage::
  576. File: dvips.info,  Node: Including headers from TeX,  Next: Including headers from the command line,  Up: Header files
  577. Including headers from TeX
  578. --------------------------
  579.   In order to get a particular graphic file to work, a certain font or
  580. header file might need to be sent first.  The Dvips program provides
  581. support for this with the `header' `\special'.  For instance, to ensure
  582. that `foo.ps' gets downloaded:
  583.      \special{header=foo.ps}
  584.   As another example, if you have some PostScript code that uses a
  585. PostScript font not built into your printer, you must download it to the
  586. printer. If the font isn't used elsewhere in the document, Dvips can't
  587. know you've used it, so you must include it in the same way, as in:
  588.      \special{header=putr.pfa}
  589. to include the font definition file for Adobe Utopia Roman.
  590. File: dvips.info,  Node: Including headers from the command line,  Next: Headers and memory usage,  Prev: Including headers from TeX,  Up: Header files
  591. Including headers from the command line
  592. ---------------------------------------
  593.   You can include headers when you run Dvips, as well as from your
  594. document (see the previous section).  To do this, run Dvips with the
  595. option `-P HEADER'; this will read the file `config.HEADER', which in
  596. turn can specify a header file to be downloaded with the `h' option.
  597. *Note Configuration file commands::.  These files are called
  598. `HEADER.cfg' on MS-DOS.
  599.   You can arrange for the same file to serve as a `-P' config file and
  600. the downloadable header file, by starting the lines of PostScript code
  601. with a space, leaving only the `h' line and any comments starting in
  602. the first column.  As an example, see `contrib/volker/config.*'
  603. (`contrib/volker/*.cfg' on MS-DOS).  (These files also perform useful
  604. functions: controlling duplex/simplex mode on duplex printers, and
  605. setting various screen frequencies; `contrib/volker/README' explains
  606. further.)
  607. File: dvips.info,  Node: Headers and memory usage,  Prev: Including headers from the command line,  Up: Header files
  608. Headers and memory usage
  609. ------------------------
  610.   Dvips tries to avoid overflowing the printer's memory by splitting the
  611. output files into "sections" (see the `-i' option in *Note Option
  612. details::).  Therefore, for all header files, Dvips debits the printer
  613. VM budget by some value.  If the header file has, in its leading
  614. commentary a line of the form
  615.      %%VMusage: MIN MAX
  616. then MAX is used.  If there is no `%%VMusage' line, then the size (in
  617. bytes) of the header file is used as an approximation.
  618.   Illustrations (figure files) are also checked for `%%VMusage' line.
  619. File: dvips.info,  Node: Literal PS,  Next: Hypertext,  Prev: Header files,  Up: Interaction with PostScript
  620. Literal PostScript
  621. ==================
  622.   You can include literal PostScript code in your document in several
  623. ways.
  624. * Menu:
  625. * " special::                   To include inline PostScript code.
  626. * ps special::                  Inline PostScript without save/restore.
  627. * PostScript hooks::            Specifying code to run in the PS interpreter.
  628. * Literal headers::             Literal PostScript for the whole document.
  629. * Literal examples::            Neat example.
  630. File: dvips.info,  Node: " special,  Next: ps special,  Up: Literal PS
  631. `"' special: Literal PostScript
  632. -------------------------------
  633.   For simple graphics, or just for experimentation, literal PostScript
  634. code can be included.  Simply use a `\special' beginning with a double
  635. quote character `"'; there is no matching closing `"'.
  636.   For instance, the following (simple) graphic:
  637.   [ picture of a grey triangle ]
  638. was created by typing:
  639.      \vbox to 100bp{\vss % a bp is the same as a PostScript unit
  640.        \special{" newpath 0 0 moveto 100 100 lineto 394 0 lineto
  641.        closepath gsave 0.8 setgray fill grestore stroke}}
  642.   You are responsible for leaving space for such literal graphics, as
  643. with the `\vbox' above.
  644. File: dvips.info,  Node: ps special,  Next: PostScript hooks,  Prev: " special,  Up: Literal PS
  645. `ps' special
  646. ------------
  647.   Generally, Dvips encloses specials in a PostScript save/restore pair,
  648. guaranteeing that the special will have no effect on the rest of the
  649. document.  The `ps' special, however, allows you to insert literal
  650. PostScript instructions without this protective shield; you should
  651. understand what you're doing (and you shouldn't change the PostScript
  652. graphics state unless you are willing to take the consequences).  This
  653. command can take many forms because it has had a torturous history; any
  654. of the following will work:
  655.      \special{ps:TEXT}
  656.      \special{ps::TEXT}
  657.      \special{ps::[begin]TEXT}
  658.      \special{ps::[end]TEXT}
  659. (with longer forms taking precedence over shorter forms, when they are
  660. present).  `ps::' and `ps::[end]' do no positioning, so they can be
  661. used to continue PostScript literals started with `ps:' or
  662. `ps::[begin]'.
  663.   In addition, the variant
  664.      \special{ps: plotfile FILENAME}
  665. inserts the contents of FILENAME verbatim into the output (except for
  666. omitting lines that begin with %).  An example of the proper use of
  667. literal specials can be found in the file `rotate.tex', which makes it
  668. easy to typeset text turned in multiples of 90 degrees.
  669. File: dvips.info,  Node: Literal headers,  Next: Literal examples,  Prev: PostScript hooks,  Up: Literal PS
  670. Literal headers: `!' `\special'
  671. -------------------------------
  672.   You can download literal PostScript header code in your TeX document,
  673. for use with (for example) literal graphics code that you include later.
  674. The text of a `\special' beginning with an `!' is copied into the
  675. output file.  A dictionary `SDict' will be current when this code is
  676. executed; Dvips arranges for `SDict' to be first on the dictionary
  677. stack when any PostScript graphic is included, whether literally (the
  678. `"' special) or through macros (e.g., `epsf.tex').
  679.   For example:
  680.      \special{! /reset { 0 0 moveto} def}
  681. File: dvips.info,  Node: PostScript hooks,  Next: Literal headers,  Prev: ps special,  Up: Literal PS
  682. PostScript hooks
  683. ----------------
  684.   Besides including literal PostScript at a particular place in your
  685. document (as described in the previous section), you can also arrange to
  686. execute arbitrary PostScript code at particular times while the
  687. PostScript is printing.
  688.   If any of the PostScript names `bop-hook', `eop-hook', `start-hook',
  689. or `end-hook' are defined in `userdict', they will be executed at the
  690. beginning of a page, end of a page, start of the document, and end of a
  691. document, respectively.
  692.   When these macros are executed, the default PostScript coordinate
  693. system and origin is in effect.  Such macros can be defined in headers
  694. added by the `-h' option or the `header=' special, and might be useful
  695. for writing, for instance, `DRAFT' across the entire page, or, with the
  696. aid of a shell script, dating the document.  These macros are executed
  697. outside of the save/restore context of the individual pages, so it is
  698. possible for them to accumulate information, but if a document must be
  699. divided into sections because of memory constraints, such added
  700. information will be lost across section breaks.
  701.   The single argument to `bop-hook' is the physical page number; the
  702. first page gets zero, the second one, etc.  `bop-hook' must leave this
  703. number on the stack.  None of the other hooks are passed arguments.
  704.   As an example of what can be done, the following special will write a
  705. light grey `DRAFT' across each page in the document:
  706.      \special{!userdict begin /bop-hook{gsave 200 30 translate
  707.      65 rotate /Times-Roman findfont 216 scalefont setfont
  708.      0 0 moveto 0.7 setgray (DRAFT) show grestore}def end}
  709.   Using `bop-hook' or `eop-hook' to preserve information across pages
  710. breaks compliance with the Adobe document structuring conventions, so
  711. if you use any such tricks, you may also want to use the `-N' option to
  712. turn off structured comments (such as `%%Page').  Otherwise, programs
  713. that read your file will assume its pages are independent.
  714. File: dvips.info,  Node: Literal examples,  Prev: Literal headers,  Up: Literal PS
  715. Literal examples
  716. ----------------
  717.   To finish off this section, the following examples of literal
  718. PostScript are presented without explanation:
  719.      \def\rotninety{\special{ps:currentpoint currentpoint translate 90
  720.      rotate neg exch neg exch translate}}\font\huge=cmbx10 at 14.4truept
  721.      \setbox0=\hbox to0pt{\huge A\hss}\vskip16truept\centerline{\copy0
  722.      \special{ps:gsave}\rotninety\copy0\rotninety\copy0\rotninety
  723.      \box0\special{ps:grestore}}\vskip16truept
  724.   [ There are 4 `A' characters, each rotated 90 degrees about a
  725. common center point ]
  726.      \vbox to 2truein{\special{ps:gsave 0.3 setgray}\hrule height 2in
  727.      width\hsize\vskip-2in\special{ps:grestore}\font\big=cminch\big
  728.      \vss\special{ps:gsave 1 setgray}\vbox to 0pt{\vskip2pt
  729.      \line{\hss\hskip4pt NEAT\hss}\vss}\special{ps:0 setgray}%
  730.      \hbox{\raise2pt\line{\hss NEAT\hss}\special{ps:grestore}}\vss}
  731.   [ There is a big gray box with the word `NEAT' inside in big letters ]
  732.   Some caveats are in order, however. Make sure that each `gsave' is
  733. matched with a `grestore' on the same page.  Do not use `save' and
  734. `restore'; they can interact with the PostScript generated by Dvips if
  735. care is not taken.  Try to understand what the above macros are doing
  736. before writing your own.  The `\rotninety' macro especially has a
  737. useful trick that appears again and again.
  738. File: dvips.info,  Node: Hypertext,  Prev: Literal PS,  Up: Interaction with PostScript
  739. HyperTeXt
  740. =========
  741.   Dvips has support for producing hypertext PostScript documents.  If
  742. you specify the `-z' option, the `html:' specials described below will
  743. be converted into `pdfmark' PostScript operators to specify links.
  744. Without `-z', `html:' specials are ignored.
  745.   The resulting PostScript can then be processed by a distiller program
  746. to make a PDF file.  (It can still be handled by ordinary PostScript
  747. interpreters as well.)  Various versions of both PC and Unix distillers
  748. are supported; Ghostscript includes limited distiller support (*note
  749. Ghostscript installation::.).
  750.   Macros you can use in your TeX document to insert the specials in the
  751. first place are available from `CTAN:/support/hypertex'.  For CTAN
  752. info, *note unixtex.ftp: (kpathsea)unixtex.ftp..
  753.   This hypertext support (and original form of the documentation) was
  754. written by Mark Doyle and Tanmoy Bhattacharya as the `dvihps' program.
  755. You can retrieve their software and additional documentation via the
  756. CTAN reference above.  You may also be interested in the Java previewer
  757. IDVI, available at `http://www.win.tue.nl/~dickie/idvi', and/or in
  758. `http://www.emrg.com/texpdf.html', which describes the process of
  759. making PDF files from TeX files in more detail.
  760.   Mail archives for the original project are at
  761. `http://math.albany.edu:8800/hm/ht/'.
  762. * Menu:
  763. * Hypertext caveats::       Bitmaps poorly supported, psi.
  764. * Hypertext specials::      The details on the specials.
  765. File: dvips.info,  Node: Hypertext caveats,  Next: Hypertext specials,  Up: Hypertext
  766. Hypertext caveats
  767. -----------------
  768.   If you intend to go all the way to PDF, you will probably want to use
  769. PostScript fonts exclusively, since the Adobe PDF readers are extremely
  770. slow when dealing with bitmap fonts.  Commercial versions of the
  771. Computer Modern fonts are available from Blue Sky; public domain
  772. versions are available from CTAN sites (for CTAN info, *note
  773. unixtex.ftp: (kpathsea)unixtex.ftp.) in:
  774.      fonts/postscript/bakoma
  775.      fonts/postscript/paradissa
  776.    You may need to modify these fonts; see
  777. `http://xxx.lanl.gov/faq/bakoma.html'.
  778. Also, the Adobe distillers prior to 2.1 drop trailing space characters
  779. (character code 32) from strings.  Unfortunately, the PostScript fonts
  780. use this character code for characters other than space (notably the
  781. Greek letter psi in the `Symbol' font), and so these characters are
  782. dropped.  This bug is fixed in version 2.1.
  783.   If you can't upgrade, One workaround is to change all the trailing
  784. blanks in strings to a character code that isn't in the font. This works
  785. because the default behavior is to substitute a blank for a missing
  786. character, i.e., the distiller is fooled into substituting the right
  787. character. For instance, with the Blue Sky fonts, you can globally
  788. replace ` )' with `\200)' (with `sed', for example) and get the desired
  789. result.  With the public domain fonts, you will probably have to use a
  790. character code in the range 128 to 191 since these fonts duplicate the
  791. first 32 characters starting at 192 to avoid MS-DOS problems.
  792. File: dvips.info,  Node: Hypertext specials,  Prev: Hypertext caveats,  Up: Hypertext
  793. Hypertext specials
  794. ------------------
  795.   Current support for the World Wide Web in the TeX system does not
  796. involve modifying TeX itself.  We need only define some specials;
  797. Arthur Smith (<apsmith@aps.org>), Tanmoy Bhattacharya, and Paul
  798. Ginsparg originally proposed and implemented the following:
  799.      html:<a href="XURL">
  800.      html:<a name="NAME">
  801.      html:</a>
  802.      html:<img src="XURL">
  803.      html:<base href="XURL">
  804.   Like all TeX `\special''s, these produce no visible output, and are
  805. uninterpreted by TeX itself.  They are instructions to DVI processors
  806. only.
  807.   Here, XURL is a standard WWW uniform resource locator (URL), possibly
  808. extended with a `#TYPE.STRING' construct, where TYPE is `page',
  809. `section', `equation', `reference' (for bibliographic references),
  810. `figure', `table', etc.  For example,
  811.      \special{html:<a href="http://www.maths.tcd.ie/~tim/ch1.dvi#equation.1.1">}
  812.    is a link to equation (1.1) in an example document by Tim Murphy.
  813. See `http://www.w3.org/hypertext/WWW/Addressing/Addressing.html' for a
  814. precise description of base URL's.  (That itself is a URL, in case you
  815. were wondering.)
  816.   Descriptions of the `\special''s:
  817. `href'
  818.      Creates links in your TeX document. For example:
  819.           \special{html:<a href="http://www.tug.org/">}\TeX\ Users
  820.           Group\special{html:</a>}
  821.       The user will be able to click on the text `TeX Users Group'
  822.      while running Xdvi and get to the TUG home page.  (By the way,
  823.      this is for illustration. In practice, you most likely want to use
  824.      macros to insert the `\special' commands; reference above.)
  825. `name'
  826.      Defines URL targets in your TeX documents, so links can be
  827.      resolved. For example:
  828.           \special{html:<a name="#paradise">}Paradise\special{html:</a>}
  829.           is exactly where you are right now.
  830.      This will resolve an `href="paradise"'.
  831. `img'
  832.      Links to an arbitrary external file.  Interactively, a viewer is
  833.      spawned to read the file according to the file extension and your
  834.      `mailcap' file (see the Xdvi documentation).
  835. `base'
  836.      Defines a base URL that is prepended to all the `name' targets.
  837.      Typically unnecessary, as the name of the DVI file being read is
  838.      used by default.
  839.   The `img' and `base' tags are not yet implemented in Dvips or the
  840. NeXTSTEP DVI viewer.
  841. File: dvips.info,  Node: PostScript fonts,  Next: Color,  Prev: Interaction with PostScript,  Up: Top
  842. PostScript fonts
  843. ****************
  844.   Dvips supports the use of PostScript fonts in TeX documents.  To use
  845. a PostScript font conveniently, you need to prepare a corresponding
  846. virtual font; the program Afm2tfm, supplied with Dvips, helps with that.
  847.   All the necessary support for the standard 35 PostScript fonts
  848. (`AvantGarde-Book' through `ZapfDingbats'), plus other freely or
  849. commonly available PostScript fonts is available along with Dvips.  To
  850. use these fonts, you need do nothing beyond what is mentioned in the
  851. installation procedure (*note Installation::.).  This chapter is
  852. therefore relevant only if you are installing new PostScript fonts not
  853. supplied with Dvips. (Or if you're curious.)
  854. * Menu:
  855. * Font concepts::               Metrics, glyphs, virtual fonts, and encodings.
  856. * Making a font available::     Installing and using a PostScript font.
  857. * Invoking afm2tfm::            Creating TFM and AFM files for a virtual font.
  858. * psfonts.map::                 Defining available PostScript fonts.
  859. File: dvips.info,  Node: Font concepts,  Next: Making a font available,  Up: PostScript fonts
  860. Font concepts
  861. =============
  862.   The information needed to typeset using a particular font is contained
  863. in two files: a "metric file" that contains shape-independent
  864. information and a "glyph file" that contains the actual shapes of the
  865. font's characters.  A "virtual font" is an optional additional file
  866. that can specify special ways to construct the characters.  TeX itself
  867. (or LaTeX) look only at the metric file, but DVI drivers such as Dvips
  868. look at all three of these files.
  869.   An "encoding file" defines the correspondence between the code
  870. numbers of the characters in a font and their descriptive names.  Two
  871. encoding files used together can describe a reencoding that rearranges,
  872. i.e., renumbers, the characters of a font.
  873. * Menu:
  874. * Metric files::                Shape-independent font information.
  875. * Glyph files::                 Character shapes.
  876. * Virtual fonts::               Constructing one font from others.
  877. * Encodings::                   Character codes and character names.
  878. * PostScript typesetting::      How PostScript typesets a character.
  879.